import Vue from 'vue'
import Router from 'vue-router'

import login from '@/components/login'
import update from '@/components/update'
import merchantInfo from '@/components/merchantInfo'
import insert from '@/components/insert'
import test from '@/components/test'
import index from '@/components/index'
import ShopIndex from '@/components/shop/ShopIndex'
import updateShop from '@/components/shop/updateShop'
import deleteShop from '@/components/shop/deleteShop'
import insertShop from '@/components/shop/insertShop'
import FoodsList from "@/components/food/FoodsList";
import FoodAdd from "@/components/food/FoodAdd";
import FoodUpdate from "@/components/food/FoodUpdate";
import CategoryList from "@/components/food/CategoryList";
import CategoryUpdate from "@/components/food/CategoryUpdate";
import CategoryAdd from "@/components/food/CategoryAdd";
import consumer from "@/components/consumer-vue/consumer.vue";
import AddConsumer from "@/components/consumer-vue/AddConsumer";
import updateConsumer from "@/components/consumer-vue/updateConsumer";


Vue.use(Router)

export default new Router({
  routes: [

    {
      path: '/',
      name: '登录',
      component: login,
      meta: {
        keepAlive: false
      }
    },

    {
      path: '/update',
      name: '修改页面',
      component: update,
      meta: {
        keepAlive: true
      }
    },
    {
      path: '/merchantInfo',
      name: '商家信息页面',
      component: merchantInfo,
      meta: {
        keepAlive: true
      }
    },
    {
      path: '/insert',
      name: '添加商家信息',
      component: insert,
      meta: {
        keepAlive: true
      }
    },

    {
      path: '/test',
      name: '测试页面',
      component: test,
      meta: {
        keepAlive: true
      }
    },
    {
      path: '/index',
      name: '后台登录首页',
      component: index,
      meta: {
        keepAlive: true
      }
    },

    {
      path: '/ShopIndex',
      name: '商家信息首页',
      component: ShopIndex,
      meta: {
        keepAlive: true
      }
    },

    {
      path: '/updateShop/:sid',
      name: '商家信息修改页面',
      component: updateShop,
      meta: {
        keepAlive: true
      }
    },

    {
      path: '/deleteShop',
      name: '商家信息删除页面',
      component: deleteShop,
      meta: {
        keepAlive: true
      }
    },

    {
      path: '/insertShop',
      name: '商家信息新增页面',
      component: insertShop,
      meta: {
        keepAlive: true
      }
    },
    {
      path: '/foodsList',
      name: '菜品展示界面',
      component: FoodsList,
      meta: {
        keepAlive: true
      }
    },
    {
      path: '/foodAdd',
      name: '增加菜品',
      component: FoodAdd,
      meta: {
        keepAlive: true
      }
    },
    {
      path: '/foodUpdate/:id',
      name: '菜品更新界面',
      component: FoodUpdate,
      meta: {
        keepAlive: true
      }
    },
    {
      path: '/categoryList',
      name: '菜品种类展示界面',
      component: CategoryList,
      meta: {
        keepAlive: true
      }
    },
    {
      path: '/categoryUpdate/:id',
      name: '菜品更新界面',
      component: CategoryUpdate,
      meta: {
        keepAlive: true
      }
    },
    {
      path: '/categoryAdd',
      name: '增加菜品种类',
      component: CategoryAdd,
      meta: {
        keepAlive: true
      }
    },
    {
      path: '/consumer',
      name: '用户列表',
      component: consumer,
      meta: {
        keepAlive: true
      }
    },
    {
      path: '/AddConsumer',
      name: 'AddConsumer',
      component: AddConsumer,
      meta: {
        keepAlive: true
      }
    },
    {
      path: '/updateConsumer/:cid',
      name: '修改信息',
      component: updateConsumer,
      meta: {
        keepAlive: true
      }
    }


  ]
})
